.TH "src/process/decode/decode.c" 3 "Thu Oct 11 2012" "Version 1.0" "Dissasemble" \" -*- nroff -*-
.ad l
.nh
.SH NAME
src/process/decode/decode.c \- 
.SH SYNOPSIS
.br
.PP
\fC#include 'decode\&.h'\fP
.br
\fC#include <common\&.h>\fP
.br
\fC#include <myLib\&.h>\fP
.br
\fC#include 'process/instructionRefParser/insParser\&.h'\fP
.br

.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fBCODE_FOR_OP_TYPE\fP"
.br
.RI "\fIStructure containing the code and size of an operation according its type\&. \fP"
.ti -1c
.RI "struct \fBs_AddressingMethod\fP"
.br
.RI "\fIStructure containing the Addressing method of an operation\&. \fP"
.ti -1c
.RI "struct \fBs_PrefixDescriptor\fP"
.br
.RI "\fIStructure containing the prefixes to be identified within a statement\&. \fP"
.ti -1c
.RI "struct \fBs_decoding\fP"
.br
.RI "\fIStructure containing information of a decoded instruction\&. \fP"
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "char \fBdetermineByteFunction\fP (char *buf)"
.br
.RI "\fIFunction that determines the processing functionality byte\&. \fP"
.ti -1c
.RI "void \fBprepareForNextInstruction\fP ()"
.br
.RI "\fIThe system is prepared to analyze the NEXT instruction\&. \fP"
.ti -1c
.RI "char \fBnumberOfOperands\fP (char opcode)"
.br
.ti -1c
.RI "\fBUINT8\fP \fBisInNoOPList\fP (\fBUINT8\fP op)"
.br
.RI "\fIVerify that the operation code is not in the list of no operators\&. \fP"
.ti -1c
.RI "\fBREG_VALUES\fP * \fBgetRegister\fP (\fBUINT8\fP value, \fBUINT8\fP \fBsize\fP)"
.br
.RI "\fIGets the corresponding register according the value and size\&. \fP"
.ti -1c
.RI "char \fBgetSizeOfOperand\fP (\fBINT8\fP *opType, \fBINT8\fP *opAddrMode)"
.br
.RI "\fIGets the operand size according to the operation type and addressing method\&. \fP"
.ti -1c
.RI "char \fBhasExntesion\fP (char byte, char *list)"
.br
.RI "\fIVerify in the instruction has extensions\&. \fP"
.ti -1c
.RI "char \fBgetSizeOfInstruction\fP (\fBINT8\fP *buf)"
.br
.RI "\fIGets the instruction size according to the attribute analysis\&. \fP"
.ti -1c
.RI "char \fBdecodeOneByteOpcode\fP (char *buf)"
.br
.RI "\fIProcess that analyzes and disassembles instructions with one byte opcode\&. \fP"
.ti -1c
.RI "char \fBdecodePrefix\fP (char *buf)"
.br
.RI "\fIProcess that analyzes and identifies prefixes into the instruction analyzed\&. \fP"
.ti -1c
.RI "char \fBdecodeTwoByteOpcode\fP (char *buf)"
.br
.RI "\fIProcess that analyzes and disassembles instructions with two byte opcode\&. \fP"
.ti -1c
.RI "char \fBisPrefix\fP (\fBINT8\fP *buf)"
.br
.RI "\fIProcess that analyzes and identifies if buf is a prefix\&. \fP"
.ti -1c
.RI "char \fBdecode\fP (char *buf, \fBUINT8\fP *decodedSize, \fBMACHINE_INSTRUCTION\fP *instructionDecoded)"
.br
.RI "\fIState machine that controls the disassembly process\&. \fP"
.in -1c
.SS "Variables"

.in +1c
.ti -1c
.RI "\fBINT8\fP * \fBgBuf\fP"
.br
.RI "\fIGlobal Buffer containing the instruction to be processed\&. \fP"
.ti -1c
.RI "\fBUINT32\fP \fBgAddress\fP = 0"
.br
.RI "\fIAddress to be access\&. \fP"
.ti -1c
.RI "\fBs_AddressingMethod\fP \fBAddresingMethodList\fP []"
.br
.RI "\fIArray of addressing methods available\&. \fP"
.ti -1c
.RI "\fBs_PrefixDescriptor\fP \fBPrefixDescriptionList\fP []"
.br
.RI "\fIArray of prefix options\&. \fP"
.ti -1c
.RI "\fBREG_VALUES\fP \fBreg_values_list\fP []"
.br
.RI "\fIArray containing the different record types according to their size\&. \fP"
.ti -1c
.RI "\fBs_decoding\fP \fBdecodeMachine\fP"
.br
.RI "\fIState machine\&. \fP"
.ti -1c
.RI "char \fBOneByteExtensionInstructions\fP []"
.br
.RI "\fIArray containing one byte instruction codes\&. \fP"
.ti -1c
.RI "char \fBTwoByteExtensionInstructions\fP []"
.br
.RI "\fIArray containing one byte instruction codes\&. \fP"
.ti -1c
.RI "\fBUINT8\fP \fBnoOpList\fP []"
.br
.RI "\fIArray containing the hexadecimal are not considered opcode\&. \fP"
.ti -1c
.RI "\fBCODE_FOR_OP_TYPE\fP \fBoperandTypeCodes\fP []"
.br
.RI "\fIArray containing the attributes of the different operand types\&. \fP"
.in -1c
.SH "Function Documentation"
.PP 
.SS "\fBdecode\fP (char *buf, \fBUINT8\fP *decodedSize, \fBMACHINE_INSTRUCTION\fP *instructionDecoded)"
.PP
State machine that controls the disassembly process\&. \fBParameters:\fP
.RS 4
\fIbuf\fP Buffer containing the piece of the file to be analyzed 
.br
\fIdecodedSize\fP Size of the instruction to be decoded 
.br
\fIinstructionDecoded\fP Object containing the attibutes of the decoded instruction 
.RE
.PP

.SS "\fBdecodeOneByteOpcode\fP (char *buf)"
.PP
Process that analyzes and disassembles instructions with one byte opcode\&. \fBParameters:\fP
.RS 4
\fIbuf\fP Buffer containing the piece of the file to be analyzed 
.RE
.PP

.SS "\fBdecodePrefix\fP (char *buf)"
.PP
Process that analyzes and identifies prefixes into the instruction analyzed\&. \fBParameters:\fP
.RS 4
\fIbuf\fP Buffer containing the piece of the file to be analyzed 
.RE
.PP

.SS "\fBdecodeTwoByteOpcode\fP (char *buf)"
.PP
Process that analyzes and disassembles instructions with two byte opcode\&. \fBParameters:\fP
.RS 4
\fIbuf\fP Buffer containing the piece of the file to be analyzed 
.RE
.PP

.SS "char \fBdetermineByteFunction\fP (char *buf)"
.PP
Function that determines the processing functionality byte\&. \fBParameters:\fP
.RS 4
\fIbuf\fP Buffer containing the piece of the file to be analyzed 
.RE
.PP

.SS "\fBgetRegister\fP (\fBUINT8\fPvalue, \fBUINT8\fPsize)"
.PP
Gets the corresponding register according the value and size\&. \fBParameters:\fP
.RS 4
\fIvalue\fP Register value 
.br
\fIsize\fP Register size 
.RE
.PP

.SS "\fBgetSizeOfInstruction\fP (\fBINT8\fP *buf)"
.PP
Gets the instruction size according to the attribute analysis\&. \fBParameters:\fP
.RS 4
\fIbuf\fP Buffer containing the piece of the file to be analyzed 
.RE
.PP

.SS "\fBgetSizeOfOperand\fP (\fBINT8\fP *opType, \fBINT8\fP *opAddrMode)"
.PP
Gets the operand size according to the operation type and addressing method\&. \fBParameters:\fP
.RS 4
\fIopType\fP Operation type 
.br
\fIopAddrMode\fP Addressing method 
.RE
.PP

.SS "\fBhasExntesion\fP (charbyte, char *list)"
.PP
Verify in the instruction has extensions\&. \fBParameters:\fP
.RS 4
\fIbyte\fP 
.br
\fIlist\fP 
.RE
.PP

.SS "\fBisInNoOPList\fP (\fBUINT8\fPop)"
.PP
Verify that the operation code is not in the list of no operators\&. \fBParameters:\fP
.RS 4
\fIop\fP Operation code 
.RE
.PP

.SS "\fBisPrefix\fP (\fBINT8\fP *buf)"
.PP
Process that analyzes and identifies if buf is a prefix\&. \fBParameters:\fP
.RS 4
\fIbuf\fP Buffer containing the piece of the file to be analyzed 
.RE
.PP

.SS "char \fBnumberOfOperands\fP (charopcode)"
.SS "\fBprepareForNextInstruction\fP ()"
.PP
The system is prepared to analyze the NEXT instruction\&. 
.SH "Variable Documentation"
.PP 
.SS "\fBs_AddressingMethod\fP \fBAddresingMethodList\fP[]"
.PP
Array of addressing methods available\&. 
.SS "\fBs_decoding\fP \fBdecodeMachine\fP"
.PP
State machine\&. 
.SS "\fBUINT32\fP \fBgAddress\fP = 0"
.PP
Address to be access\&. 
.SS "\fBINT8\fP* \fBgBuf\fP"
.PP
Global Buffer containing the instruction to be processed\&. 
.SS "\fBUINT8\fP \fBnoOpList\fP[]"\fBInitial value:\fP
.PP
.nf

{ 0x50, 0x58, 0x90, 0xb0, 0xb8 }
.fi
.PP
Array containing the hexadecimal are not considered opcode\&. 
.SS "char \fBOneByteExtensionInstructions\fP[]"\fBInitial value:\fP
.PP
.nf

{ 0x50, 0x58, 0x90, 0xb0, 0xb8, '\0' }
.fi
.PP
Array containing one byte instruction codes\&. 
.SS "\fBCODE_FOR_OP_TYPE\fP \fBoperandTypeCodes\fP[]"
.PP
Array containing the attributes of the different operand types\&. 
.SS "\fBs_PrefixDescriptor\fP \fBPrefixDescriptionList\fP[]"
.PP
Array of prefix options\&. 
.SS "\fBREG_VALUES\fP \fBreg_values_list\fP[]"
.PP
Array containing the different record types according to their size\&. 
.SS "char \fBTwoByteExtensionInstructions\fP[]"\fBInitial value:\fP
.PP
.nf

{ 0xc8 }
.fi
.PP
Array containing one byte instruction codes\&. 
.SH "Author"
.PP 
Generated automatically by Doxygen for Dissasemble from the source code\&.
